	//............................................................................cef_browser_capi

	TCefBrowser=record
		// Base structure.
		base:TCefBase;
		// Returns the browser host object. This function can only be called in the
		// browser process.
		get_host:function(self:PCefBrowser):PCefBrowserHost; cconv;
		// Returns true (1) if the browser can navigate backwards.
		can_go_back:function(self:PCefBrowser):integer; cconv;
		// Navigate backwards.
		go_back:procedure(self:PCefBrowser); cconv;
		// Returns true (1) if the browser can navigate forwards.
		can_go_forward:function(self:PCefBrowser):integer; cconv;
		// Navigate forwards.
		go_forward:procedure(self:PCefBrowser); cconv;
		// Returns true (1) if the browser is currently loading.
		is_loading:function(self:PCefBrowser):integer; cconv;
		// Reload the current page.
		reload:procedure(self:PCefBrowser); cconv;
		// Reload the current page ignoring any cached data.
		reload_ignore_cache:procedure(self:PCefBrowser); cconv;
		// Stop loading the page.
		stop_load:procedure(self:PCefBrowser); cconv;
		// Returns the globally unique identifier for this browser.
		get_identifier:function(self:PCefBrowser):integer; cconv;
		// Returns true (1) if this object is pointing to the same handle as |that|
		// object.
		is_same:function(self:PCefBrowser; that:PCefBrowser):integer; cconv;
		// Returns true (1) if the window is a popup window.
		is_popup:function(self:PCefBrowser):integer; cconv;
		// Returns true (1) if a document has been loaded in the browser.
		has_document:function(self:PCefBrowser):integer; cconv;
		// Returns the main (top-level) frame for the browser window.
		get_main_frame:function(self:PCefBrowser):PCefFrame; cconv;
		// Returns the focused frame for the browser window.
		get_focused_frame:function(self:PCefBrowser):PCefFrame; cconv;
		// Returns the frame with the specified identifier, or NULL if not found.
		get_frame_byident:function(self:PCefBrowser; identifier:Tint64):PCefFrame; cconv;
		// Returns the frame with the specified name, or NULL if not found.
		get_frame:function(self:PCefBrowser; const name:PCefString):PCefFrame; cconv;
		// Returns the number of frames that currently exist.
		get_frame_count:function(self:PCefBrowser):TSize; cconv;
		// Returns the identifiers of all existing frames.
		get_frame_identifiers:procedure(self:PCefBrowser; identifiersCount:PSize; identifiers:Pint64); cconv;
		// Returns the names of all existing frames.
		get_frame_names:procedure(self:PCefBrowser; names:TCefStringList); cconv;
		// Send a message to the specified |target_process|. Returns true (1) if the
		// message was sent successfully.
		send_process_message:function(self:PCefBrowser; target_process:TCefProcessId; message:PCefProcessMessage):integer; cconv;
	end;

	TCefRunFileDialogCallback=record
		// Base structure.
		base:TCefBase;
		// Called asynchronously after the file dialog is dismissed. If the selection
		// was successful |file_paths| will be a single value or a list of values
		// depending on the dialog mode. If the selection was cancelled |file_paths|
		// will be NULL.
		cont:procedure(self:PCefRunFileDialogCallback; browser_host:PCefBrowserHost; file_paths:TCefStringList); cconv;
	end;

	TCefBrowserHost=record
		// Base structure.
		base:TCefBase;
		// Returns the hosted browser object.
		get_browser:function(self:PCefBrowserHost):PCefBrowser; cconv;

        // Call this function before destroying a contained browser window. This
        // function performs any internal cleanup that may be needed before the
        // browser window is destroyed. See cef_life_span_handler_t::do_close()
        // documentation for additional usage information.
        //void (CEF_CALLBACK *parent_window_will_close)(
        //    struct _cef_browser_host_t* self);
        //parent_window_will_close: procedure(self:PCefBrowserHost); cconv;

		// Request that the browser close. The JavaScript 'onbeforeunload' event will
		// be fired. If |force_close| is false (0) the event handler, if any, will be
		// allowed to prompt the user and the user can optionally cancel the close. If
		// |force_close| is true (1) the prompt will not be displayed and the close
		// will proceed. Results in a call to cef_life_span_handler_t::do_close() if
		// the event handler allows the close or if |force_close| is true (1). See
		// cef_life_span_handler_t::do_close() documentation for additional usage
		// information.
		close_browser: procedure(self: PCefBrowserHost; force_close: integer); cconv;

        // Set focus for the browser window. If |enable| is true (1) focus will be set
        // to the window. Otherwise, focus will be removed.
		set_focus: procedure(self: PCefBrowserHost; enable: integer); cconv;

        // Set whether the window containing the browser is visible
        // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X.
        set_window_visibility: procedure(self: PCefBrowserHost; visible: Integer); cconv;


        // Retrieve the window handle for this browser.
		get_window_handle: function(self:PCefBrowserHost):TCefWindowHandle; cconv;
		// Retrieve the window handle of the browser that opened this browser. Will
		// return NULL for non-popup windows. This function can be used in combination
		// with custom handling of modal windows.
		get_opener_window_handle: function(self:PCefBrowserHost):TCefWindowHandle; cconv;
		// Returns the client for this browser.
		get_client:function(self:PCefBrowserHost):PCefClient; cconv;

        // Returns the request context for this browser.
		get_request_context: function(self: PCefBrowserHost): PCefRequestContext; cconv;

        // Get the current zoom level. The default zoom level is 0.0. This function
		// can only be called on the UI thread.
		get_zoom_level:function(self:PCefBrowserHost):Tdouble; cconv;
		// Change the zoom level to the specified value. Specify 0.0 to reset the zoom
		// level. If called on the UI thread the change will be applied immediately.
		// Otherwise, the change will be applied asynchronously on the UI thread.
		set_zoom_level:procedure(self:PCefBrowserHost; zoomLevel:Tdouble); cconv;
		// Call to run a file chooser dialog. Only a single file chooser dialog may be
		// pending at any given time. |mode| represents the type of dialog to display.
		// |title| to the title to be used for the dialog and may be NULL to show the
		// default title ("Open" or "Save" depending on the mode). |default_file_name|
		// is the default file name to select in the dialog. |accept_types| is a list
		// of valid lower-cased MIME types or file extensions specified in an input
		// element and is used to restrict selectable files to such types. |callback|
		// will be executed after the dialog is dismissed or immediately if another
		// dialog is already pending. The dialog will be initiated asynchronously on
		// the UI thread.
		run_file_dialog: procedure(
            self: PCefBrowserHost;
            mode: TCefFileDialogMode;
            const title: PCefString;
            const default_file_name: PCefString;
            accept_types: TCefStringList;
            callback: PCefRunFileDialogCallback); cconv;
		// Download the file at |url| using cef_download_handler_t.
		start_download:procedure(self:PCefBrowserHost; const url:PCefString); cconv;

		// Print the current browser contents.
        print: procedure(self: PCefBrowserHost); cconv;

		// Search for |searchText|. |identifier| can be used to have multiple searches
		// running simultaniously. |forward| indicates whether to search forward or
		// backward within the page. |matchCase| indicates whether the search should
		// be case-sensitive. |findNext| indicates whether this is the first request
		// or a follow-up.
		find: procedure(
            self: PCefBrowserHost;
            identifier: integer;
            const searchText: PCefString;
            forward: integer;
            matchCase: integer;
            findNext: integer); cconv;

		// Cancel all searches that are currently going on.
		stop_finding: procedure(
            self: PCefBrowserHost;
            clearSelection: integer); cconv;

        // Open developer tools in its own window.
        show_dev_tools: procedure(
            self: PCefBrowserHost;
            windowInfo: PCefWindowInfo;
            client: PCefClient;
            settings: PCefBrowserSettings); cconv;

        // Explicitly close the developer tools window if one exists for this browser
        // instance.
        close_dev_tools: procedure(self: PCefBrowserHost); cconv;

        // Set whether mouse cursor change is disabled.
		set_mouse_cursor_change_disabled: procedure(self: PCefBrowserHost; disabled: integer); cconv;
		
		// Returns true (1) if mouse cursor change is disabled.
		is_mouse_cursor_change_disabled: function(self: PCefBrowserHost): integer; cconv;

        // Returns true (1) if window rendering is disabled.
		is_window_rendering_disabled: function(self: PCefBrowserHost): integer; cconv;

        // Notify the browser that the widget has been resized. The browser will first
		// call cef_render_handler_t::GetViewRect to get the new size and then call
		// cef_render_handler_t::OnPaint asynchronously with the updated regions. This
		// function is only used when window rendering is disabled.
		was_resized: procedure(self: PCefBrowserHost); cconv;

        // Notify the browser that it has been hidden or shown. Layouting and
		// cef_render_handler_t::OnPaint notification will stop when the browser is
		// hidden. This function is only used when window rendering is disabled.
		was_hidden: procedure(self: PCefBrowserHost; hidden: integer); cconv;

        // Send a notification to the browser that the screen info has changed. The
		// browser will then call cef_render_handler_t::GetScreenInfo to update the
		// screen information with the new values. This simulates moving the webview
		// window from one display to another, or changing the properties of the
		// current display. This function is only used when window rendering is
		// disabled.
		notify_screen_info_changed: procedure(self: PCefBrowserHost); cconv;

        {$ifdef cef_stable}
        // Invalidate the |dirtyRect| region of the view. The browser will call
		// cef_render_handler_t::OnPaint asynchronously with the updated regions. This
		// function is only used when window rendering is disabled.
		invalidate: procedure(self: PCefBrowserHost; const dirtyRect: PCefRect; _type: TCefPaintElementType); cconv;
        {$endif cef_stable}
        {$ifdef cef_trunk}
        // Invalidate the view. The browser will call cef_render_handler_t::OnPaint
        // asynchronously. This function is only used when window rendering is
        // disabled.
		invalidate: procedure(self: PCefBrowserHost; _type: TCefPaintElementType); cconv;
        {$endif cef_trunk}

        // Send a key event to the browser.
		send_key_event:procedure(self:PCefBrowserHost; const event:PCefKeyEvent); cconv;

        // Send a mouse click event to the browser. The |x| and |y| coordinates are
		// relative to the upper-left corner of the view.
		send_mouse_click_event:procedure(self:PCefBrowserHost; const event:PCefMouseEvent; _type:TCefMouseButtonType; mouseUp:integer; clickCount:integer); cconv;

        // Send a mouse move event to the browser. The |x| and |y| coordinates are
		// relative to the upper-left corner of the view.
		send_mouse_move_event:procedure(self:PCefBrowserHost; const event:PCefMouseEvent; mouseLeave:integer); cconv;

        // Send a mouse wheel event to the browser. The |x| and |y| coordinates are
		// relative to the upper-left corner of the view. The |deltaX| and |deltaY|
		// values represent the movement delta in the X and Y directions respectively.
		// In order to scroll inside select popups with window rendering disabled
        // cef_render_handler_t::GetScreenPoint should be implemented properly.
		send_mouse_wheel_event:procedure(self:PCefBrowserHost; const event:PCefMouseEvent; deltaX:integer; deltaY:integer); cconv;

        // Send a focus event to the browser.
		send_focus_event:procedure(self:PCefBrowserHost; setFocus:integer); cconv;

        // Send a capture lost event to the browser.
		send_capture_lost_event:procedure(self:PCefBrowserHost); cconv;

        // Get the NSTextInputContext implementation for enabling IME on Mac when
		// window rendering is disabled.
		get_nstext_input_context: function(self: PCefBrowserHost): TCefTextInputContext; cconv;

        // Handles a keyDown event prior to passing it through the NSTextInputClient
		// machinery.
		handle_key_event_before_text_input_client: procedure(self: PCefBrowserHost; keyEvent: TCefEventHandle); cconv;

        // Performs any additional actions after NSTextInputClient handles the event.
		handle_key_event_after_text_input_client: procedure(self: PCefBrowserHost; keyEvent: TCefEventHandle); cconv;
		
		// Call this function when the user drags the mouse into the web view (before
		// calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
		// should not contain file contents as this type of data is not allowed to be
		// dragged into the web view. File contents can be removed using
		// cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from
		// cef_render_handler_t::StartDragging). This function is only used when
		// window rendering is disabled.
		drag_target_drag_enter: procedure(
			self: PCefBrowserHost;
			drag_data: PCefDragData;
            const event: PCefMouseEvent;
            allowed_ops: TCefDragOperationsMask); cconv;

        // Call this function each time the mouse is moved across the web view during
        // a drag operation (after calling DragTargetDragEnter and before calling
        // DragTargetDragLeave/DragTargetDrop). This function is only used when window
        // rendering is disabled.
        drag_target_drag_over: procedure(
		    self: PCefBrowserHost;
            const event: PCefMouseEvent;
            allowed_ops: TCefDragOperationsMask); cconv;

        // Call this function when the user drags the mouse out of the web view (after
        // calling DragTargetDragEnter). This function is only used when window
        // rendering is disabled.
        //void (CEF_CALLBACK *drag_target_drag_leave)(struct _cef_browser_host_t* self);
        drag_target_drag_leave: procedure(self: PCefBrowserHost); cconv;

        // Call this function when the user completes the drag operation by dropping
        // the object onto the web view (after calling DragTargetDragEnter). The
        // object being dropped is |drag_data|, given as an argument to the previous
        // DragTargetDragEnter call. This function is only used when window rendering
        // is disabled.
        drag_target_drop: procedure(
   		    self: PCefBrowserHost;
            const event: PCefMouseEvent); cconv;

        // Call this function when the drag operation started by a
        // cef_render_handler_t::StartDragging call has ended either in a drop or by
        // being cancelled. |x| and |y| are mouse coordinates relative to the upper-
        // left corner of the view. If the web view is both the drag source and the
        // drag target then all DragTarget* functions should be called before
        // DragSource* mthods. This function is only used when window rendering is
        // disabled.
        drag_source_ended_at: procedure(
       	    self: PCefBrowserHost;
            x, y: Integer;
            op: TCefDragOperationsMask); cconv;

        // Call this function when the drag operation started by a
        // cef_render_handler_t::StartDragging call has completed. This function may
        // be called immediately without first calling DragSourceEndedAt to cancel a
        // drag operation. If the web view is both the drag source and the drag target
        // then all DragTarget* functions should be called before DragSource* mthods.
        // This function is only used when window rendering is disabled.
        ///
        //void (CEF_CALLBACK *drag_source_system_drag_ended)(
        //    struct _cef_browser_host_t* self);
        drag_source_system_drag_ended: procedure(self: PCefBrowserHost); cconv;
	end;

    // Create a new browser window using the window parameters specified by
    // |windowInfo|. All values will be copied internally and the actual window will
    // be created on the UI thread. This function can be called on any browser
    // process thread and will not block.
    tfn_cef_browser_host_create_browser = function(
        const windowInfo: PCefWindowInfo;
        client: PCefClient;
        const url: PCefString;
        const settings: PCefBrowserSettings;
        const request_context: PCefRequestContext): Integer; cdecl;

    // Create a new browser window using the window parameters specified by
    // |windowInfo|. If |request_context| is NULL the global request context will be
    // used. This function can only be called on the browser process UI thread.
    tfn_cef_browser_host_create_browser_sync = function(
        const windowInfo: PCefWindowInfo;
        client: PCefClient;
        const url: PCefString;
        const settings: PCefBrowserSettings;
        const request_context: PCefRequestContext): PCefBrowser; cdecl;

